package tech.aistar.corejava.day05.homework02;

/**
 * @author success
 * @version 1.0
 * @description:本类用来演示:
 * @date 2019/7/23 0023
 */
public class Person {
    private String name;

    //char是固定字符 - 尽量不要使用char类型

    //状态性的属性 - 未来是使用枚举类型
    //现阶段使用int类型即可.
    private int gender;//性别 1代表男 0代表女

    private int age;

    private boolean isMarry;//是否婚配  true代表已婚   false代表未婚

    //未来如何和框架结合,getter/setter 一定用get或者set开头
    //boolean类型的get比较特殊

    public Person(){

    }

    public Person(String name, int gender, int age, boolean isMarry) {
        this.name = name;
        this.gender = gender;
        this.age = age;
        this.isMarry = isMarry;
    }

    public boolean getIsMarry() {
        return isMarry;
    }

    public void setIsMarry(boolean marry) {
        isMarry = marry;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getGender() {
        return gender;
    }

    public void setGender(int gender) {
        this.gender = gender;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("Person{");
        sb.append("name='").append(name).append('\'');
        sb.append(", gender=").append(gender);
        sb.append(", age=").append(age);
        sb.append(", isMarry=").append(isMarry);
        sb.append('}');
        return sb.toString();
    }
}
